<?php

/**
 * LevelI18n form.
 *
 * @package    elearning
 * @subpackage form
 * @author     Your name here
 */
class LevelI18nForm extends BaseLevelI18nForm
{
  public function configure()
  {
  	if( !$this->isNew() )
	{
		//khong cho edit levelname
		//unset( $this['level_name'] );
	}
	//new sfWidgetFormTextarea()
	$this->widgetSchema['structure_and_goals'] = new sfWidgetFormTextarea();
	$this->widgetSchema['result_at_complete'] = new sfWidgetFormTextarea();
	$this->widgetSchema['target_population'] = new sfWidgetFormTextarea();
	$this->widgetSchema->setLabels(  
		 array(  
			 'level_name'      		=> 'Level Name', 
			 'level_description'    => 'Description', 
			 'vocabulary'			=> 'Vocabulary',  
			 'fluence'				=> 'Fluence',
			 'grammar'				=> 'Grammar',
			 'structure_and_goals'	=> 'Structure And Goals',
			 'result_at_complete'	=> 'Result At Complete',
			 'target_population'	=> 'Target Population'  
		 )  
	 ); 
	 $this->widgetSchema->setNameFormat('level_i18n[%s]');
	 
	//code de cho hien thi * o cac truong require cung add them 2 dong o backend.css
	$decorator = new sidFormFormatter($this->widgetSchema, $this->validatorSchema);
    $this->widgetSchema->addFormFormatter('custom', $decorator);
    $this->widgetSchema->setFormFormatterName('custom');
  }
}
